<script language="javascript" type="text/javascript"
	src="<?php echo $this->load->config->item('base_url') . $this->load->config->item('inc_folder'); ?>scripts/jquery-2.0.3.js"></script>
<script type="text/javascript">
	$(function() {  
        $('#tglawal').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
	
	$(function() {  
        $('#tglakhir').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
</script>

<div id="container">

<h1><?php //echo $nama_perusahaan; ?></h1>
<h2><?php //echo $alamat_perusahaan; ?></h2>
    <div id="body">
        <?php
            //echo $bio;
            //echo $menu;
        ?>
        <div class="cleaner_h10"></div>
        <table align="center">
            <tr align="center">
                <td>
                    <?php
                        //echo $paginator;
                    ?>
                </td>
            </tr>
        </table>
		<div class="cleaner_h10"></div>
        <form method="post" name="frmSearch" action="<?php echo site_url('lappembeliancontroller');?>">
		<table width="100%" cellpadding="3" cellspacing="0" border="1">
			<tr>
                <td width="90"><strong>Tanggal</strong></td>
                <td>:</td>
                <td width="172"><input type="text"  name="tglawal" id="tglawal" maxlength="10" value="" style="width:110px;"/></td>
                <td width="30"><strong>S/D </strong></td>
                <td width="542"><input type="text"  name="tglakhir" id="tglakhir" maxlength="10" value="" style="width:110px;"/></td>
            </tr>
            <tr>
            	<td width="75"><strong>No Faktur</strong></td>
                <td width="11"><strong>:</strong></td>
                <td colspan="3"><input type="text"  name="nofaktur" id="nofaktur" maxlength="11"/></td>
            </tr>
			<tr valign="top">
            	<td></td>
                <td colspan="5"><input type="submit" value="Search" name="btnview" ></td>
			</tr>
		</table>
        </form>
        <br />
      	<div class="cleaner_h10"></div>
        <form method="post" name="frmexcel" action="<?php echo site_url('lappembeliancontroller/toExcel');?>">
        	<?php if(isset($tglAkhir) && isset($tglAwal)){?>
            <input type="hidden" name="tglAkhir" value="{tglAkhir}" />
      		<input type="hidden" name="tglAwal" value="{tglAwal}" />
      		<?php }?>
      		<?php if(isset($nofak)){?>
      		<input type="hidden" name="noFaktur" value="{nofak}" />
      		<?php } ?>
            <table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
                <tr style="background-color:#FFFFFF; color:#000000;" align="center">
                    <td colspan="9" height="25"><strong>Laporan Pembelian</strong></td>
                </tr>
                <tr style="background-color:#333; color:#FFFFFF;" align="center">
                    <td>No Faktur</td>
                    <td>Tanggal Faktur</td>
                    <td>No PO</td>
                    <td>Nama Barang</td>
                    <td>Quantity</td>
                    <td>Discount</td>
                    <td>Amount</td>
                    <td>Keterangan</td>
                    <td>Nama Pembuat</td>
                </tr>
                <?php 
                    if(count($dt_faktur)>0)
                    { 
                ?>
                {dt_faktur}
                <tr class="cellDefault">
                    <td>{NoFaktur}</td>
                    <td>{DateFaktur}</td>
                    <td>{NoPo}</td>
                    <td>{nmbrgdet}</td> 
                    <td>{Quantity}</td>
                    <td>{Discount}</td>
                    <td>{Amount}</td>
                    <td>{Keterangan}</td>
                    <td>{CreatedBy}</td>
                    <input type="hidden"  name="kdfktrno" id="kdfktrno" size="50" value="{NoFaktur}" />
                </tr>
                {/dt_faktur}
                <?php 
                    } 
                    else
                    {
                        echo "<tr>";
                        echo "<td colspan='9' style='text-align:center;color:red;'>No Data To Display</td>";
                        echo "</tr>";
                    } 
                ?>
            </table>
            <table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
                <tr align="center">
                    <td colspan="9">
                        <input type="submit" name="btntoxl" value="Export" />&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:window.location='<?php echo site_url('menuhomecontroller'); ?>';" />
                    </td>
                </tr>
            </table>
        </form>
        <?php echo $links; ?>
    	<div class="cleaner_h10"></div>
		<table align="center">
			<tr align="center">
				<td>
					<?php
						//echo $paginator;
					?>
				</td>
			</tr>
		</table>
	</div>
